package com.dl.helloworld;

import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class ForceOfflineReceiver extends BroadcastReceiver {


    @Override
    public void onReceive(Context context, Intent intent) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setTitle("Warning");
        builder.setMessage("强制下线，重新登陆");
        builder.setCancelable(false);
        builder.setPositiveButton("OK", (dialog,which)->{
            ActivityController.finishAll();
            Intent intent1 = new Intent(context,LoginActivity.class);
            context.startActivity(intent1);
        } );
        builder.show();
    }
}
